# -*- coding: UTF-8 -*-    
# Author:yangshuoshuo
# FileName:practice_module
# DateTime:2024/5/29 22:39
# SoftWare: PyCharm

"""
import random


print(random.random())

print(random.randint(1, 10))

print(random.uniform(1, 10))

a = "hello python hi"
print(random.choice(a))

list1 = ["a", "b", "c"]
random.shuffle(list1)
print(list1)

"""
import os
import sys

"""
num: int = 10
print(num)

num2: int = 'aaa'
print(num2)


def show(n: int, msg: str) -> None:
    for i in range(n):
        print(msg)


def show_tuple(data: tuple) -> None:
    for i in data:
        print(i)


def show_tuple1(data: tuple[int]) -> None:
    for i in data:
        print(i)


show_tuple1((1,))
show_tuple1((1, 2, 3))  # 不符合注解类型
show_tuple1(('a', 'b', 'c'))  # 不符合注解类型
show_tuple1((1, 2, 3, 'a', 'b', 'c'))  # 不符合注解类型


def show_tuple2(data: tuple[int, float, str]) -> None:
    for i in data:
        print(i)


show_tuple2((1, 1.2, '222'))
show_tuple2((1, 2, 3))

from typing import Any


def show_tuple2(data: tuple[Any, ...]) -> None:
    for i in data:
        print(i)


show_tuple2((1, 1.2, '222', "嘿嘿"))

from typing import Union


def show1(data: Union[str, int, float, tuple, dict]) -> None:
    print(data)


from typing import Sequence


def show2(data: Sequence[int]) -> None:
    print(data)


show2((1, 2, 3))
show2([1, 2, 3])
show2("123")
"""

"""
for i in range(10):
    if i == 6:
        print("exit...")
        sys.exit("正常退出了")
    print(f"running{i}...")
    time.sleep(1)


print(dir(sys))
print(help(sys))

print(sys.argv)

print("Python 解释器版本：", sys.version)

print("Python 解释器版本信息：", sys.version_info)
print(type(sys.version_info))

print("Python 解释器版本信息：", sys.version_info[0])
print("Python 解释器版本信息：", sys.version_info[1])

print(sys.platform)

for module_name, module in sys.modules.items():
    print(f"模块名：{module_name}, 模块对象：{module}")
    
    
import sys


try:
    raise ValueError("hhh")
except ValueError as e:
    print(sys.exc_info())

# 获取系统当前编码
print(sys.getdefaultencoding())
"""

"""
import os

print(os.name)
print(os.environ)
print(os.getenv("ALLUSERSPROFILE"))
os.system("dir")

name = "霍格沃兹"
print(id(name))

school = "霍格沃兹"
print(id(school))
"""

"""
print(sys.version)
print(sys.getdefaultencoding())
print(sys.exc_info())
print(sys.argv)
print(sys.path)
"""

print(os.name)
print(os.sep)